<?php get_header(); ?>

    <!-- Slider
    ======================================= -->
<?php get_template_part('block', 'slider') ?>


    <div class="clearfix mar_top3"></div>

    <div class="container">

        <div class="features_section">

            <h2>Các dịch vụ của chúng tôi</h2>
            <?php $services_index = ot_get_option('services_index');
            $i = 1;
            if (!empty($services_index))
                foreach ($services_index as $service_index):
                    if ($i % 3 == 0) {
                        $class_last = 'last';
                        $class_end = '<div class="clearfix mar_top2"></div>';
                    } else {
                        $class_last = '';
                        $class_end = '';
                    }
                    ?>

                    <div class="sections <?php echo $class_last ?>">
                        <div class="left">
                            <a href="<?php echo $service_index['link'] ?>"><img src="<?php echo $service_index['image'] ?>" alt="<?php echo esc_attr($service_index['name']) ?>" width="70" height="60"/></a>
                        </div>
                        <div class="right">
                            <h4><a href="<?php echo $service_index['link'] ?>"><?php echo $service_index['name'] ?></a>
                            </h4>

                            <p><?php echo $service_index['des'] ?></p>
                        </div>
                    </div>
                    <!-- end section -->

                    <?php echo $class_end ?>


                    <?php $i++;
                endforeach; ?>
        </div>
        <!-- end all sections -->


    </div><!-- end all sections -->


    <div class="hosting_plans">

        <div class="container">

            <div class="title_text"><img src="<?php echo THEME_URL ?>/images/text-hostinclu.png" alt="dich vu noi bat"/>
            </div>
            <?php $featured_products = Azio_Posts::getProducts(4, '', 'showindex', true, '', 'ASC');
            //var_dump($featured_products);
            ?>
            <?php $i = 1;
            if ($featured_products)
                foreach ($featured_products as $featured_product):

                    $product_fields = Azio_Posts::getProductField($featured_product->ID);

                    $term_product = get_the_terms($featured_product->ID, 'producttype');
                    $term_product = reset($term_product);
                    $term_product_link = get_term_link($term_product, 'producttype');

                    //var_dump($term_product);
                    if ($i % 4 == 0) {
                        $class_last = 'last';
                    } else {
                        $class_last = '';
                    }
                    //var_dump($product_fields);
                    ?>
                    <div class="hostplan <?php echo $class_last ?>">
                        <div class="title">
                            <span class="index-price"><?php echo number_format($product_fields['gia'], 0, ',', ','); ?>
                                <br/><i>/ <?php echo $product_fields['donvithanhtoan'] ?></i></span>
                            <span class="index-service">
                                <span style="font-size: 11px; font-weight: bold;"> <?php echo $term_product->name ?></span><br/>
                                <?php echo $featured_product->post_title ?></span></div>
                        <ul>
                            <?php foreach ($product_fields['thongso'] as $thongso) {
                                echo '<li>' . $thongso['thongso_chitiet'] . '</li>';
                            } ?>
                            <li class="noarrow">
                                <a href="<?php echo $term_product_link ?>" class="black_button">Xem chi tiết</a></li>
                        </ul>
                        <div class="shadow"></div>
                    </div>
                    <!-- end host plan -->
                    <?php $i++;
                endforeach; ?>
        </div>

    </div><!-- end all hosting plans -->

    <div class="clearfix mar_top3"></div>

    <div class="container">
        <?php
        $block_one_cat = ot_get_option('block_one_cat', 6);
        $block_one_posts = Azio_Posts::getPosts(4, $block_one_cat);
        $block_one_posts_first = array_shift($block_one_posts);?>
        <div class="home_aboutarea">
            <div class="left">
                <a href="<?php echo $block_one_posts_first->permalink ?>" title="<?php echo esc_attr($block_one_posts_first->post_title) ?>">
                    <img src="<?php echo $block_one_posts_first->image_thumbnail ?>" alt="<?php echo esc_attr($block_one_posts_first->post_title) ?>" width="210" height="158"/>
                </a>
            </div>
            <div class="right">
                <h3>
                    <a href="<?php echo $block_one_posts_first->permalink ?>" title="<?php echo esc_attr($block_one_posts_first->post_title) ?>"><?php echo $block_one_posts_first->post_title ?></a>
                </h3>

                <p><?php echo Azio_Posts::cut_tring_by_char($block_one_posts_first->excerpt, 250) ?></p>
            </div>
        </div>
        <!-- end section -->


        <div class="accrodation">
            <?php $i = 1;
            foreach ($block_one_posts as $block_one_post):
                if ($i == 1) {
                    $class_active = "active";
                } else {
                    $class_active = "";
                }?>
                <!-- section 1 -->
                <span class="acc-trigger <?php echo $class_active ?>"><a href="#" title="<?php echo esc_attr($block_one_post->post_title) ?>"><?php echo Azio_Posts::cut_tring_by_char($block_one_post->post_title, 32) ?></a></span>

                <div class="acc-container">
                    <div class="content">
                        <?php echo Azio_Posts::cut_tring_by_char($block_one_post->excerpt, 80) ?><br/>
                        <a href="<?php echo $block_one_post->permalink ?>" class="highlight blue">Chi tiết...</a>
                    </div>
                </div>
                <?php $i++;
            endforeach ?>
        </div>


    </div>

    <div class="clearfix mar_top13"></div>

    <div class="features_section_two">

        <div class="container">

            <div class="sections">

                <h2>Các dịch vụ khác</h2>

                <?php $orther_services = ot_get_option('dichvukhac', array());
                if (!empty($orther_services)):
                    $i = 1;
                    ?>
                    <ul class="hosting_includes_list">
                        <?php foreach ($orther_services as $orther_service): ?>
                            <li>
                                <a href="<?php echo $orther_service['dichvukhac_lienket'] ?>"><img src="<?php echo $orther_service['dichvukhac_hinhanh'] ?>" alt="orther-sevice"/></a>
                                <h4>
                                    <a href="<?php echo $orther_service['dichvukhac_lienket'] ?>"><?php echo $orther_service['dichvukhac_tendichvu'] ?></a>
                                </h4>
                            </li>
                        <?php endforeach ?>
                    </ul>
                <?php endif ?>
            </div>
            <!-- end section-->

            <div class="sections">

                <div class="people_says_main">

                    <h2>ĐÁNH GIÁ</h2>

                    <div class="people_says">

                        <div class="jcarousel-skin-tango">
                            <div class="jcarousel-container jcarousel-container-horizontal" style="position: relative; display: block;">
                                <div class="jcarousel-clip jcarousel-clip-horizontal" style="position: relative;">
                                    <ul id="mycarousel" class="jcarousel-list jcarousel-list-horizontal" style="overflow: hidden; position: relative; top: 0px; margin: 0px; padding: 0px; left: 0px; width: 1540px;">

                                        <?php
                                        $testimonials = Azio_Posts::getPosts(5, '', '', '', '', 'testimonial');
                                        foreach ($testimonials as $key => $testimonial):
                                            ?>
                                            <li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-<?php echo $key + 1 ?> jcarousel-item-1-horizontal" jcarouselindex="<?php echo $key + 1 ?>" style="float: left; list-style: none;">
                                                <img src="<?php echo THEME_URL ?>/images/quotes1.png" alt="" class="image_left7">

                                                <?php echo Azio_Posts::cut_tring_by_char(strip_tags($testimonial->post_content), 220) ?>

                                                <img src="<?php echo THEME_URL ?>/images/quotes2.png" alt="" class="image_left11">

                                                <div class="who_pic">
                                                    <div class="name"><strong><?php echo $testimonial->post_title ?></strong>
                                                        <i><?php echo $testimonial->post_excerpt ?></i></div>
                                                </div>
                                            </li>
                                        <?php endforeach ?>

                                    </ul>
                                </div>
                                <div class="jcarousel-prev jcarousel-prev-horizontal jcarousel-prev-disabled jcarousel-prev-disabled-horizontal" disabled="disabled" style="display: block;"></div>
                                <div class="jcarousel-next jcarousel-next-horizontal" style="display: block;"></div>
                            </div>
                        </div>

                        <div style="text-align: center;"><a href="/danh-gia/" title="Gửi ý kiến" class="but_table">Xem và gửi ý kiến</a></div>
                    </div>


                </div>


            </div>
            <!-- end section-->

            <div class="sections last">

                <div class="ad_one">
                    <a href="#"><img src="<?php echo THEME_URL ?>/images/ads_index_1.jpg"/></a>
                </div>
                <!-- end ad-->

                <div class="clearfix mar_top2"></div>

                <div class="ad_two">
                    <a href="#"><img src="<?php echo THEME_URL ?>/images/ads_index_2.jpg"/></a>
                </div>
                <!-- end ad-->

            </div>
            <!-- end section-->

        </div>

    </div>

    <div class="clearfix mar_top3"></div>




<?php get_footer(); ?>